Skip to content

Testing Refactor#363

Open
lispandfound wants to merge 78 commits intomasterfrom
testing_infra_refactor
Open

Testing Refactor#363
lispandfound wants to merge 78 commits intomasterfrom
testing_infra_refactor

Conversation

@lispandfound
Copy link
Contributor

@lispandfound lispandfound commented Jan 7, 2026

This PR does three things that couldn't easily be separated:

  1. Moves from Jenkins to GitHub Actions for our standard PR workflow.
  2. Migrates tests out of the qcore package into the tests folder
  3. Adds a bunch more tests to improve coverage for the functions that weren't previously deleted.

As part of (1) and (2), the PR moved to a pyproject.toml based setup for everything and deleted the requirements.txt

Note

The high line count is because I added a uv.lock file to get the GitHub Actions to reliably reproduce.

Note

Coverage check fails for now because of numba functions. This is addressed in #365 and #366

lispandfound and others added 30 commits November 12, 2025 16:44
* Initial plan

* Add test coverage for explicit raise statements

Co-authored-by: lispandfound <12835929+lispandfound@users.noreply.github.com>

* Add comprehensive test coverage for geo module

Co-authored-by: lispandfound <12835929+lispandfound@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: lispandfound <12835929+lispandfound@users.noreply.github.com>
* Initial plan

* Add basic tests for omitted modules

Co-authored-by: lispandfound <12835929+lispandfound@users.noreply.github.com>

* fix: fix ruff and type-checking

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: lispandfound <12835929+lispandfound@users.noreply.github.com>
Co-authored-by: Jake Faulkner <jake.faulkner@canterbury.ac.nz>
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @lispandfound, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request represents a substantial refactoring effort aimed at modernizing the project's development and testing infrastructure. By migrating to GitHub Actions and a pyproject.toml setup, the project benefits from improved automation, clearer dependency management, and a more organized test suite. The addition of numerous new tests further enhances the robustness and maintainability of the codebase, ensuring higher quality and more reliable future development.

Highlights

  • CI/CD Migration: The project has transitioned its standard Pull Request workflow from Jenkins to GitHub Actions, streamlining the continuous integration and delivery process.
  • Test Infrastructure Refactor: All tests have been migrated out of the qcore package and into a dedicated tests folder, improving project structure and test discoverability.
  • Dependency Management Update: The project now uses a pyproject.toml based setup for dependency management, replacing the requirements.txt file and providing a more modern and standardized approach.
  • Increased Test Coverage: A significant number of new tests have been added across various modules to improve overall code coverage and ensure the reliability of existing functionalities.
Ignored Files
  • Ignored by pattern: .github/workflows/** (5)
    • .github/workflows/deptry.yml
    • .github/workflows/git-extension.yml
    • .github/workflows/publish-PyPi.yml
    • .github/workflows/pytest.yml
    • .github/workflows/ruff.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a significant and valuable refactoring of the project. The migration from Jenkins to GitHub Actions, the move to a pyproject.toml-based setup, and the relocation and expansion of tests are all excellent steps towards modernizing the repository and improving its maintainability. The new tests are comprehensive, using property-based testing and covering many edge cases, which greatly increases confidence in the code's correctness and robustness. Overall, this is a high-quality contribution. I have one point of clarification regarding the packaged data.

@lispandfound
Copy link
Contributor Author

Coverage is improved in type checking PR which adds some coverage exclusions for the numba functions that are causing low test coverage.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR performs a major infrastructure refactoring by migrating from Jenkins to GitHub Actions for CI/CD, reorganizing the test suite from qcore/test/ to a top-level tests/ directory, and modernizing the build configuration to use pyproject.toml instead of requirements.txt. The changes also include significant test coverage improvements by adding new test cases for previously untested or under-tested functionality.

Key Changes:

  • Migrated CI/CD from Jenkins to GitHub Actions with workflows for pytest, ruff, and deptry
  • Moved all tests from qcore/test/ to tests/ directory following pytest conventions
  • Converted dependency management from requirements.txt to pyproject.toml with explicit dependencies
  • Added extensive test coverage for functions in utils, timeseries, siteamp, simulation_structure, shared, point_in_polygon, nhm, geo, coordinates, CLI, and archive_structure modules

Reviewed changes

Copilot reviewed 24 out of 54 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/test_xyts.py Added type assertions and invalid file handling test
tests/test_utils.py New test file for YAML loading functionality
tests/test_timeseries.py Added comprehensive tests for text output, error handling, and edge cases
tests/test_src_site_dist.py New comprehensive test suite for distance calculations
tests/test_siteamp.py Added return type annotations and input validation tests
tests/test_simulation_structure.py New test suite for simulation structure path utilities
tests/test_shared.py New test suite for station and corner parsing utilities
tests/test_point_in_polygon.py New test suite for polygon containment checks
tests/test_nhm.py New comprehensive test suite for NHM fault operations
tests/test_grid.py Added return type annotations and type assertion tests
tests/test_geo.py New comprehensive test suite for geographic calculations
tests/test_coordinates.py Code formatting improvements and consistency fixes
tests/test_cli.py Enhanced CLI testing with additional edge cases
tests/test_archive_structure.py New test suite for archive path utilities
pyproject.toml Migrated from requirements.txt with explicit dependencies and version constraints
.github/workflows/*.yml New GitHub Actions workflows for pytest, ruff, deptry checks
requirements.txt Deleted in favor of pyproject.toml
Jenkinsfile Deleted as part of migration to GitHub Actions
qcore/test/* All test files removed as tests migrated to top-level tests/ directory
Comments suppressed due to low confidence (2)

tests/test_timeseries.py:951

  • Missing import for tempfile module. The code uses tempfile.TemporaryFile but doesn't import tempfile at the top of the file.
    tests/test_coordinates.py:92
  • Variable geod is not used.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@lispandfound lispandfound changed the base branch from remove_old_functions to master January 13, 2026 23:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants